3.7.41 \(\int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx\) [641]

3.7.41.1 Optimal result
3.7.41.2 Mathematica [A] (verified)
3.7.41.3 Rubi [A] (verified)
3.7.41.4 Maple [F]
3.7.41.5 Fricas [F]
3.7.41.6 Sympy [F]
3.7.41.7 Maxima [F]
3.7.41.8 Giac [F]
3.7.41.9 Mupad [F(-1)]

3.7.41.1 Optimal result

Integrand size = 23, antiderivative size = 147 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\frac {a b (2+m) (d \sec (e+f x))^m}{f m (1+m)}+\frac {d \left (b^2-a^2 (1+m)\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-m}{2},\frac {3-m}{2},\cos ^2(e+f x)\right ) (d \sec (e+f x))^{-1+m} \sin (e+f x)}{f (1-m) (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)} \]

output
a*b*(2+m)*(d*sec(f*x+e))^m/f/m/(1+m)+d*(b^2-a^2*(1+m))*hypergeom([1/2, -1/ 
2*m+1/2],[3/2-1/2*m],cos(f*x+e)^2)*(d*sec(f*x+e))^(-1+m)*sin(f*x+e)/f/(-m^ 
2+1)/(sin(f*x+e)^2)^(1/2)+b*(d*sec(f*x+e))^m*(a+b*tan(f*x+e))/f/(1+m)
 
3.7.41.2 Mathematica [A] (verified)

Time = 0.82 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.81 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\frac {(d \sec (e+f x))^m \left (b^2 \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},\frac {m}{2},\frac {2+m}{2},\sec ^2(e+f x)\right ) \tan (e+f x)+a \left (-a \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m}{2},\frac {2+m}{2},\sec ^2(e+f x)\right ) \tan (e+f x)+2 b \sqrt {-\tan ^2(e+f x)}\right )\right )}{f m \sqrt {-\tan ^2(e+f x)}} \]

input
Integrate[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^2,x]
 
output
((d*Sec[e + f*x])^m*(b^2*Hypergeometric2F1[-1/2, m/2, (2 + m)/2, Sec[e + f 
*x]^2]*Tan[e + f*x] + a*(-(a*Hypergeometric2F1[1/2, m/2, (2 + m)/2, Sec[e 
+ f*x]^2]*Tan[e + f*x]) + 2*b*Sqrt[-Tan[e + f*x]^2])))/(f*m*Sqrt[-Tan[e + 
f*x]^2])
 
3.7.41.3 Rubi [A] (verified)

Time = 0.65 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 3993, 25, 3042, 3967, 3042, 4259, 3042, 3122}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a+b \tan (e+f x))^2 (d \sec (e+f x))^m \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (e+f x))^2 (d \sec (e+f x))^mdx\)

\(\Big \downarrow \) 3993

\(\displaystyle \frac {\int -(d \sec (e+f x))^m \left (-\left ((m+1) a^2\right )-b (m+2) \tan (e+f x) a+b^2\right )dx}{m+1}+\frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\int (d \sec (e+f x))^m \left (-\left ((m+1) a^2\right )-b (m+2) \tan (e+f x) a+b^2\right )dx}{m+1}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\int (d \sec (e+f x))^m \left (-\left ((m+1) a^2\right )-b (m+2) \tan (e+f x) a+b^2\right )dx}{m+1}\)

\(\Big \downarrow \) 3967

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\left (b^2-a^2 (m+1)\right ) \int (d \sec (e+f x))^mdx-\frac {a b (m+2) (d \sec (e+f x))^m}{f m}}{m+1}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\left (b^2-a^2 (m+1)\right ) \int \left (d \csc \left (e+f x+\frac {\pi }{2}\right )\right )^mdx-\frac {a b (m+2) (d \sec (e+f x))^m}{f m}}{m+1}\)

\(\Big \downarrow \) 4259

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\left (b^2-a^2 (m+1)\right ) \left (\frac {\cos (e+f x)}{d}\right )^m (d \sec (e+f x))^m \int \left (\frac {\cos (e+f x)}{d}\right )^{-m}dx-\frac {a b (m+2) (d \sec (e+f x))^m}{f m}}{m+1}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {\left (b^2-a^2 (m+1)\right ) \left (\frac {\cos (e+f x)}{d}\right )^m (d \sec (e+f x))^m \int \left (\frac {\sin \left (e+f x+\frac {\pi }{2}\right )}{d}\right )^{-m}dx-\frac {a b (m+2) (d \sec (e+f x))^m}{f m}}{m+1}\)

\(\Big \downarrow \) 3122

\(\displaystyle \frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)}-\frac {-\frac {d \left (b^2-a^2 (m+1)\right ) \sin (e+f x) (d \sec (e+f x))^{m-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-m}{2},\frac {3-m}{2},\cos ^2(e+f x)\right )}{f (1-m) \sqrt {\sin ^2(e+f x)}}-\frac {a b (m+2) (d \sec (e+f x))^m}{f m}}{m+1}\)

input
Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^2,x]
 
output
-((-((a*b*(2 + m)*(d*Sec[e + f*x])^m)/(f*m)) - (d*(b^2 - a^2*(1 + m))*Hype 
rgeometric2F1[1/2, (1 - m)/2, (3 - m)/2, Cos[e + f*x]^2]*(d*Sec[e + f*x])^ 
(-1 + m)*Sin[e + f*x])/(f*(1 - m)*Sqrt[Sin[e + f*x]^2]))/(1 + m)) + (b*(d* 
Sec[e + f*x])^m*(a + b*Tan[e + f*x]))/(f*(1 + m))
 

3.7.41.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3122
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( 
b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 
F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] 
 &&  !IntegerQ[2*n]
 

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 3993
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^2, x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])/(f*(m 
 + 1))), x] + Simp[1/(m + 1)   Int[(d*Sec[e + f*x])^m*(a^2*(m + 1) - b^2 + 
a*b*(m + 2)*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && NeQ[a^ 
2 + b^2, 0] &&  !IntegerQ[m]
 

rule 4259
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x] 
)^(n - 1)*((Sin[c + d*x]/b)^(n - 1)   Int[1/(Sin[c + d*x]/b)^n, x]), x] /; 
FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]
 
3.7.41.4 Maple [F]

\[\int \left (d \sec \left (f x +e \right )\right )^{m} \left (a +b \tan \left (f x +e \right )\right )^{2}d x\]

input
int((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x)
 
output
int((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x)
 
3.7.41.5 Fricas [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{2} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

input
integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="fricas")
 
output
integral((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)*(d*sec(f*x + e))^ 
m, x)
 
3.7.41.6 Sympy [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\int \left (d \sec {\left (e + f x \right )}\right )^{m} \left (a + b \tan {\left (e + f x \right )}\right )^{2}\, dx \]

input
integrate((d*sec(f*x+e))**m*(a+b*tan(f*x+e))**2,x)
 
output
Integral((d*sec(e + f*x))**m*(a + b*tan(e + f*x))**2, x)
 
3.7.41.7 Maxima [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{2} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

input
integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="maxima")
 
output
integrate((b*tan(f*x + e) + a)^2*(d*sec(f*x + e))^m, x)
 
3.7.41.8 Giac [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )}^{2} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

input
integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="giac")
 
output
integrate((b*tan(f*x + e) + a)^2*(d*sec(f*x + e))^m, x)
 
3.7.41.9 Mupad [F(-1)]

Timed out. \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx=\int {\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^m\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2 \,d x \]

input
int((d/cos(e + f*x))^m*(a + b*tan(e + f*x))^2,x)
 
output
int((d/cos(e + f*x))^m*(a + b*tan(e + f*x))^2, x)